home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 5: The Fifth Dimension
/
17 Bit - The Fifth Dimension (1995)(17 Bit Software)[!].iso
/
files
/
3728.dms
/
3728.adf
/
XPKDisk
/
xpkdisk.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-08
|
5KB
|
194 lines
/*-
* XPKDISK.H
*
* $Id: xpkdisk.h,v 1.6 1995/04/08 20:23:48 Rhialto Exp $
* $Log: xpkdisk.h,v $
* Revision 1.6 1995/04/08 20:23:48 Rhialto
* Add/correct version strings.
*
* Revision 1.5 1995/04/02 14:58:51 Rhialto
* Increase stack of device's Process to 8K.
* Introduce #define for length of trackfile name.
*
* Revision 1.4 1993/12/29 17:52:19 Rhialto
* Creating the ripcord file was not done right.
*
* Revision 1.3 1993/11/08 13:11:15 Rhialto
* Add RCS tags.
*
*
* This code is (C) Copyright 1989-1993 by Olaf Seibert. All rights reserved.
* May not be used or copied without a licence.
-*/
#ifndef EXEC_MEMORY_H
#include <exec/memory.h>
#endif
#ifndef EXEC_DEVICES_H
#include <exec/devices.h>
#endif
#ifndef EXEC_ERRORS_H
#include "exec/errors.h"
#endif
#ifndef EXEC_SEMAPHORES_H
#include "exec/semaphores.h"
#endif
#ifndef DEVICES_TRACKDISK_H
#include <devices/trackdisk.h>
#endif
#ifndef LIBRARIES_DOSEXTENS_H
#include <libraries/dosextens.h>
#endif
#ifndef CLIB_EXEC_PROTOS_H
#include <clib/exec_protos.h>
#endif
#ifndef CLIB_ALIB_PROTOS_H
#include <clib/alib_protos.h>
#endif
#ifndef CLIB_DOS_PROTOS_H
#include <clib/dos_protos.h>
#endif
extern struct ExecBase *SysBase;
#define XD_NUMUNITS 8
#define XD_BPS 512
#define XD_SPT 64 /* default value */
#define XD_TRACKLEN (XD_BPS * XD_SPT)
#define VERSION SYS2_04
#define REVISION 8
typedef unsigned char byte;
typedef unsigned short ushort;
typedef unsigned long ulong;
struct XpkDiskDevice {
struct Device xd_Dev;
long xd_Seglist;
struct XpkDiskUnit *xd_Unit[XD_NUMUNITS-1];
};
#define dev_Node xd_Dev.dd_Library.lib_Node
#define dev_Flags xd_Dev.dd_Library.lib_Flags
#define dev_NegSize xd_Dev.dd_Library.lib_NegSize
#define dev_PosSize xd_Dev.dd_Library.lib_PosSize
#define dev_Version xd_Dev.dd_Library.lib_Version
#define dev_Revision xd_Dev.dd_Library.lib_Revision
#define dev_IdString xd_Dev.dd_Library.lib_IdString
#define dev_OpenCnt xd_Dev.dd_Library.lib_OpenCnt
struct Cache {
struct MinList LRUList;
};
struct XpkDiskUnit {
struct MsgPort xu_Port;
/* User configurable parameters first */
short xu_MaxCache;
ushort xu_CacheFlags;
short xu_CacheTimeout;
char xu_XPKPackMethod[10]; /* "XXXX.100" */
short xu_OpenCnt;
short xu_UnitNr;
ushort xu_Flags;
struct Cache xu_Cache;
short xu_CurrentCache;
ushort xu_CacheDirty;
short xu_TimeoutCounter;
int xu_NumTracks; /* a guess */
int xu_TrackLen;
struct MinList xu_ChangeIntList;
struct MsgPort xu_TimerPort;
struct timerequest xu_TimeReq;
int xu_RipcordBlocks;
char xu_WriteErr; /* was there a write problem? */
char xu_ReadOnly;
};
#define TDERR_NoError 0
#define UNITB_ACTIVE 0
#define UNITF_STOPPED (1<<2)
#define UNITF_WAKETASK (1<<3)
#define CACHE_TIMEOUT 5
#define MAX_CACHE 8
#define PACKING_METHOD "BLZW.100"
#define CACHEF_CMDUPDATE 0x0001
#define CACHEF_DELAY 0x0002
#define CACHEF_SAFEWRITE 0x0004
#define CACHEF_GOTCMDUPD 0x0100
#define CACHEF_GOTTIMEOUT 0x0200
#define CACHEF_LICENSED 0x8000
#define CACHE_FLAGS (CACHEF_CMDUPDATE | CACHEF_DELAY | CACHEF_SAFEWRITE)
#define XPKDISKDIR "XPKD:"
/* Names of configuration parameters, as seen by the user */
#define CONFIGFILE "ENV:XpkDisk%x.prefs"
#define CONFIGFILE_ARC XPKDISKDIR "XpkDisk%x.prefs"
#define TRACKNAME_LENGTH 40
#define S_CMDUPDATE "CMDUPDATE"
#define S_DELAY "DELAY"
#define S_SAFEWRITE "SAFE"
#define S_LICENSED "LICENSED"
#define S_MaxCache "CACHE"
#define S_CacheTimeout "TIME"
#define S_XPKPackMethod "METHOD"
#define SYS1_2 33 /* System version 1.2 */
#define SYS1_3 34 /* System version 1.3 */
#define SYS2_0 36 /* System version 2.0 */
#define SYS2_04 37 /* System version 2.04 */
typedef struct XpkDiskDevice DEV;
typedef struct XpkDiskUnit UNIT;
#define TASKPRI 0L
#define TASKSTACK 8192L
#define STRIP(cmd) ((unsigned char)cmd)
#define IMMEDIATE ((1<<CMD_INVALID)|\
(1<<CMD_STOP)|(1<<CMD_START)|(1<<CMD_FLUSH)|\
(1L<<TD_ADDCHANGEINT)|\
(1L<<TD_REMOVE)|(1L<<TD_RAWREAD)|(1L<<TD_RAWWRITE)|\
(1L<<TD_GETDRIVETYPE)|(1L<<TD_EJECT)|\
(1L<<TD_SEEK)|(1L<<TD_CHANGENUM)|(1L<<TD_CHANGESTATE)|\
(1L<<TD_PROTSTATUS))
#define PerformIO(ioreq, unit) \
(funcTable[STRIP(ioreq->io_Command)])(ioreq, unit)
#define TD_Remove CMD_Invalid
#define TD_Rawread CMD_Invalid
#define TD_Rawwrite CMD_Invalid
#define TD_Getdrivetype CMD_Invalid
#define TD_Eject CMD_Invalid
#define TD_Seek TD_Return0
#define TD_Changenum TD_Return0
#define TD_Changestate TD_Return0
#define CMD_Die 0xDEAD
#define Prototype extern
#define Local static
#define STR(s) STR2(s)
#define STR2(s) #s
/*
* Prototypes:
*/
#include "proto.h"